package cn.tedu.online.day02;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

public class IteratorMap {
    public static void main(String[] args) {


        TreeMap<String, Integer> map = new TreeMap<>();

        map.put("tom",90);
        map.put("aaa",90);
        map.put("bbb",90);
        map.put("ccc",90);


        Iterator<Map.Entry<String,Integer>> it =
                map.entrySet().iterator();
        while (it.hasNext()){
            Map.Entry<String,Integer> entry = it.next();
            System.out.println(entry.getKey()+"--"+entry.getValue());
        }


    }
}
